﻿using FrameWorkSong;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TwoPrefabs : MonoBehaviourSimplify
{
    private void Start()
    {
        root();
    }
    void root()
    {
        RegisterMsg("测试方法2", OnMsgReceivedRoot);
        RegisterMsg("删除", DestroySelf);

    }
    void OnMsgReceivedRoot(object data)
    {
        Debug.Log(data);
   
    }

    public override void OnBeforeDestroy()
    {

    }
    void DestroySelf(object data)
    {
        Destroy(gameObject);
    }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            SendMsg("测试方法", "测试方法");
        }
        if (Input.GetKeyDown(KeyCode.Q))
        {
            DestroySelf("");
        }
    }
}
